import java.util.Scanner;

public class ADDREV {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int t = s.nextInt();
		while (t-- > 0) {
			int i = s.nextInt();
			int j = s.nextInt();
			//System.out.println(i);
			//System.out.println(j);
			int ir = Integer.parseInt(new StringBuffer().append(i).reverse().toString());
			int jr = Integer.parseInt(new StringBuffer().append(j).reverse().toString());
			int sumr = ir + jr;
			int sum = Integer.parseInt(new StringBuffer().append(sumr).reverse().toString());
			System.out.println(sum);
		}
		s.close();
	}
}
